package com.bitbank.smartdevice.ui

import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.os.Handler
import com.bitbank.smartdevice.R
import com.mob.MobSDK
import com.qmuiteam.qmui.arch.QMUISwipeBackActivityManager
import com.qmuiteam.qmui.util.QMUIStatusBarHelper
import com.tuya.smart.sdk.TuyaSdk


/**
 *  Date：2018/12/17
 *  Author：xulee
 *  Desc：
 */

class LauncherActivity : Activity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        QMUIStatusBarHelper.translucent(this)
        window.setBackgroundDrawableResource(R.drawable.bg_theme)
        if (intent.flags and Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT != 0) {
            finish()
            return
        }

        Thread {
            MobSDK.init(this)

            TuyaSdk.init(application)
            TuyaSdk.setDebugMode(true)
        }.start()

        Handler().postDelayed({
            val intent = Intent(this, MainActivity::class.java)
            startActivity(intent)
            finish()
        }, 1500)

    }
}